import sys

class debug:
	def __init__(self, debug=False):
		self.stats = [0,0,0] # info, wargnings, errors
		self.debug = debug

	def info(self, message, *args):
		self.stats[0] += 1
		if self.debug:
			print "[*] " + message % args

	def info_s1(self, message, *args):
		self.stats[0] += 1
		if self.debug:
			print "[*] " + message % args,

	def info_s2(self, message, *args):
		if self.debug:
			print "\t " + message % args

	def warning(self, message, *args):
		self.stats[1] += 1
		if self.debug:
			print "[W] " + message % args
	
	def error(self, message, *args):
		self.stats[2] +=1
		if self.debug:
			print "[E] " + message % args
			sys.exit(1)
